﻿@model YQBlog.Models.ReplyModel
@using res = Resource.Views.Shared.Shared;
@{
    YQBlog.General.GeneralConfigInfo ci = ViewBag.CI as YQBlog.General.GeneralConfigInfo;
  } 
<div id="comment"></div>
<div id="post" class="mt10">
@if (Model.ReplyPermit == 1)
{
<div id="mustLoginTip">@res.MustLogIn, @res.Please @Html.ActionLink(res.SignIn, "LogOn", "Account") @res.Or @Html.ActionLink(res.Register, "Register", "Account")</div>   
<div id="commentWrap">   
<h2>@(res.AddComment)</h2>
<script src="@Url.Content("~/Scripts/jquery.unobtrusive-ajax.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
<div id="AjaxResult"></div>
    @using (Ajax.BeginForm("AjaxReply", new AjaxOptions { LoadingElementId = "Loading", InsertionMode = InsertionMode.InsertBefore, OnSuccess = "CommentSubmitSuccess" }))
    {
    <div id="commentform">
    <div id="insertCode">
    @res.ProLang：
    <select id="selCodeType">
        <option value="c#">C#</option>
        <option value="js">JavaScript</option>
        <option value="html">HTML</option>
        <option value="css">CSS</option>
        <option value="php">PHP</option>
        <option value="pl">Perl</option>
        <option value="py">Python</option>
        <option value="rb">Ruby</option>
        <option value="java">Java</option>
        <option value="vb">ASP/VB</option>
        <option value="cpp">C/C++</option>
        <option value="sql">SQL</option>
        <option value="xml">XML</option>
        <option value="as3">AS3</option>
        <option value="shell">Shell</option>
    </select>
    <br/>
    @res.Code：
    <textarea style="width:350px;height:200px;" id="txtCode"></textarea>
    <input type="button" onclick="InsertCode('Content')" value="@res.Submit" id="btnInsertCode"/>
    <a href="###" onclick="Hide('insertCode')">@res.Close</a>
    </div>
        <fieldset>
            <legend>@res.Content</legend>
             @Html.HiddenFor(m => m.ReplyId)
             @Html.HiddenFor(m => m.ArticleId)
             @Html.HiddenFor(m => m.CateId)
            <div class="editor-label">
                @Html.LabelFor(m => m.UserName)
            </div>
            <div class="editor-field">
                @Html.TextBoxFor(m => m.UserName)
                @Html.ValidationMessageFor(m => m.UserName)
            </div>

            <div class="editor-label">
                @Html.LabelFor(m => m.Email)
            </div>
            <div class="editor-field">
                @Html.TextBoxFor(m => m.Email)
                @Html.ValidationMessageFor(m => m.Email)
            </div>

            <div class="editor-label">
                @Html.LabelFor(m => m.Url)
            </div>
            <div class="editor-field">
                @Html.TextBoxFor(m => m.Url)
                @Html.ValidationMessageFor(m => m.Url)
            </div>

            <div class="editor-label">
                @Html.LabelFor(m => m.Content)
            </div>
            <div style="width: 600px" class="editor_ubb">
              <div> 
              <a onclick="View('insertCode')" class="tb_code" href="javascript:;">Code</a>
              <a onclick="seditor_insertunit('Content', '[url=###]', '[/url]')" class="tb_link" href="javascript:;">Link</a>
              <a onclick="seditor_insertunit('Content', '[img]', '[/img]')" class="tb_img" href="javascript:;">Image</a>
              <a onclick="seditor_insertunit('Content', '[b]', '[/b]')" class="tb_bold" href="javascript:;">B</a>
              </div>
            </div>
            <div class="editor-field clstxtarea">
                @Html.TextAreaFor(model => model.Content, new { style = "width: 600px; height: 260px" })
                @Html.ValidationMessageFor(m => m.Content)
            </div>
            <div class="validation-code">
                <div class="editor-label">
                    @Html.LabelFor(m => m.ValidationCode)
                </div>
                <div class="editor-field validation clearfix">
                    @Html.TextBoxFor(m => m.ValidationCode, new { style = "width: 60px;height:20px;margin-top:7px;" })
                    <img src="/validateCode.ashx?n=4" class="validateImg" title="@res.ChangeValidationCode"/>
                    <span class="validateCodeTip">@res.ValidationCodeError</span>
                </div>
            </div>
            <p>
                <input type="submit" value="@Resource.Views.Home.Home.Submit" id="BtnSubmit"/> <span id="Loading">@Resource.Views.Home.Home.Ajax_Wait</span>
            </p>
        </fieldset>
    </div>
    }
 </div>
}
</div>